<html>
<head><meta charset="utf-8"><title>Profile output · t-compiler/performance · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/index.html">t-compiler/performance</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html">Profile output</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="242553361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242553361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242553361">(Jun 14 2021 at 05:16)</a>:</h4>
<p>I'm trying to add an option to the compiler that allows it to output profiling data related to closure sizes.</p>
<p>Right now the way I have it setup is, it will just print to stdout. I'd like to figure out how -Zselfprofile collects the data and outputs it in a file so that I can do something similar allowing it easier for people to share their data with us</p>



<a name="242553384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242553384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242553384">(Jun 14 2021 at 05:17)</a>:</h4>
<p>If someone can point me to the code where the option is setu and the file is created and information is maintained that'd help a lot</p>



<a name="242555786"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242555786" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242555786">(Jun 14 2021 at 06:06)</a>:</h4>
<p>mw and wesley will probably help more but it's surely in measureme, probably this sink <a href="https://github.com/rust-lang/measureme/blob/master/measureme/src/serialization.rs">https://github.com/rust-lang/measureme/blob/master/measureme/src/serialization.rs</a></p>



<a name="242555903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242555903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242555903">(Jun 14 2021 at 06:09)</a>:</h4>
<p>hooked up from the session <code>prof</code> to <code>rustc_data_structures::profiling</code> <a href="https://github.com/rust-lang/rust/blob/2312ff1a850db449b79fd3c4b215395cd2598c25/compiler/rustc_data_structures/src/profiling.rs">https://github.com/rust-lang/rust/blob/2312ff1a850db449b79fd3c4b215395cd2598c25/compiler/rustc_data_structures/src/profiling.rs</a></p>



<a name="242555976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242555976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242555976">(Jun 14 2021 at 06:10)</a>:</h4>
<p>however, measureme and self-profiling may have requirements that you may not have, rustc sends it a lot of events, it's trying very hard to be performant to not skew the timing, have compact data, etc</p>



<a name="242556094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242556094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242556094">(Jun 14 2021 at 06:13)</a>:</h4>
<p>(the data it deals with is very dynamic while yours seems more static ?)</p>



<a name="242556147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242556147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242556147">(Jun 14 2021 at 06:14)</a>:</h4>
<p>so, it could interesting to look at "regular debug" output in rustc, whether the dump-mir or graphviz output features, which should be way simpler than how measureme creates its buffers and maintains its events information</p>



<a name="242637031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/247081-t-compiler/performance/topic/Profile%20output/near/242637031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/247081-t-compiler/performance/topic/Profile.20output.html#242637031">(Jun 14 2021 at 18:02)</a>:</h4>
<p>Thank you!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>